package cn.lingyangwl.agile.pay.mch.controller;

import cn.lingyangwl.framework.core.response.Resp;
import cn.lingyangwl.agile.pay.model.rqrs.PayNodeRS;
import cn.lingyangwl.agile.pay.common.service.PayNodeService;
import cn.lingyangwl.agile.ram.ActionType;
import cn.lingyangwl.agile.ram.RamResource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author shenguangyang
 */
@RestController
@RequestMapping("/payNode")
public class PayNodeController {
    @Resource
    private PayNodeService payNodeService;
    /**
     * 查询支付节点
     */
    @GetMapping("/listPayNode")
    @RamResource(action = "pay:payNode:list", name = "查询支付节点列表", type = ActionType.READ)
    public Resp<List<PayNodeRS>> listPayNode(@RequestParam("payOrderNo") String payOrderNo) {
        List<PayNodeRS> resp = payNodeService.listPayNode(payOrderNo);
        return Resp.ok(resp);
    }
}
